<!DOCTYPE html>
<html lang="zh-CN">
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1">
<title>档案系统-首页</title>
<!--[if lt IE 9]>
  <script src="libs/html5shiv.min.js"></script>
  <script src="libs/respond.min.js"></script>
  <![endif]-->
<script src="libs/jquery-1.12.1.min.js"></script>
<link href="libs/bootstrap-3.3.6/css/bootstrap.min.css" rel="stylesheet">
<script src="libs/bootstrap-3.3.6/js/bootstrap.min.js"></script>
<script type="text/javascript" src="libs/handlebars.min.js">
	
</script>
<script src="libs/jquery.backstretch.min.js"></script>
<script src="libs/js.cookie-2.1.0.min.js"></script>
</head>
<body>
	<div class="container">
		<div class="row">
			<div class="page-header">
				<h1 align="center">
					<strong>档案管理</strong>
				</h1>
			</div>
		</div>
	</div>
	<div class="container">
		<div class="row">
			<div class="col-md-12">
				<ul class="nav nav-pills ">
					<li class="active"><a href="#">首页</a></li>
					<li><a href="add.html"><strong>档案添加</strong></a></li>
					<li><a href="queryone.html"><strong>查询详细</strong></a></li>
					<li><a href="query.html"><strong>档案查询</strong></a></li>
					<li><a href="zhaopian.html"><strong>照片详情</strong></a></li>
					<li><a href="tongji.html"><strong>统计</strong></a></li>
				</ul>
				<ul class="nav nav-pills pull-right">
					<li>
						<button id="quit">退出登录</button>
					</li>
				</ul>
				<div className="input-group">
					<input className="form-control" id="search-box-value"
						placeholder="档案号或身份证号" type="text" /> <span
						className="input-group-btn">
						<button className="btn btn-default" id="queryone" type="button">
							<i className="fa fa-search">查询</i>
						</button>
					</span>
				</div>
			</div>
		</div>
	</div>
	<div class="container">
		<div class="row">
			<div class="col-md-12">
				<hr />
			</div>
		</div>
	</div>
	<div class="container">
		<div class="row">
			<div class="col-md-12">
				<div class="panel panel-warning">
					<div class="panel-heading">最近浏览的四份档案</div>
					<div class="panel-body" id="list1"></div>
				</div>
			</div>
		</div>
	</div>
	<div class="container">
		<div class="row">
			<div class="col-md-12">
				<div class="panel panel-warning">
					<div class="panel-heading">最近添加的四份档案</div>
					<div class="panel-body" id="list2"></div>
				</div>
			</div>
		</div>
	</div>
	<script id="template" type="text/x-handlebars-template">
{{#each item}}
<div class="panel panel-default col-md-3 ">
   <div class="panel-body">
     <dl>
<dt>id</dt><dd>{{id}}</dd>
<dt>档案号</dt><dd>{{archive_id}}</dd>
<dt>身份证号</dt><dd>{{identity}}</dd>
<dt>姓名</dt><dd>{{name}}</dd>
<dt>性别</dt><dd>{{gender}}</dd>
<dt>出生日期</dt><dd>{{birthday}}</dd>
<dt>预退休日期</dt><dd>{{date_retire1}}</dd>
<dt>实际退休日期</dt><dd>{{date_retire2}}</dd>
<dt>特殊工种</dt><dd>{{sp}}</dd>
<dt>女管理岗位 </dt><dd>{{fc}}</dd>
<dt>职称</dt><dd>{{title}}</dd>
<dt>工龄</dt><dd>{{seniority}}</dd>
     </dl>
   </div>
 </div>
{{/each}}
</script>

	<script id="template1" type="text/x-handlebars-template1">
{{#each item}}
<div class="panel panel-default col-md-3 ">
   <div class="panel-body">
     <dl>
<dt>id</dt><dd>{{id}}</dd>
<dt>档案号</dt><dd>{{archive_id}}</dd>
<dt>身份证号</dt><dd>{{identity}}</dd>
<dt>姓名</dt><dd>{{name}}</dd>
<dt>性别</dt><dd>{{gender}}</dd>
<dt>出生日期</dt><dd>{{birthday}}</dd>
<dt>预退休日期</dt><dd>{{date_retire1}}</dd>
<dt>实际退休日期</dt><dd>{{date_retire2}}</dd>
<dt>特殊工种</dt><dd>{{sp}}</dd>
<dt>女管理岗位 </dt><dd>{{fc}}</dd>
<dt>职称</dt><dd>{{title}}</dd>
<dt>工龄</dt><dd>{{seniority}}</dd>
     </dl>
   </div>
 </div>
{{/each}}
</script>
	<script type="text/javascript">
		$(function() {
			$.getJSON('queryl.action', function(res) {
				console.log(res);
				var data = {
					'item' : res
				};
				var t = Handlebars.compile($('#template').html());
				$('#list1').html(t(data));
			});
			$.getJSON('queryt.action', function(res) {
				console.log(res);
				var data = {
					'item' : res
				};
				var t = Handlebars.compile($('#template1').html());
				$('#list2').html(t(data));
			});
		})
	</script>

	<script type="text/javascript">
		$(function() {
			$('#quit').click(function() {
				$.post('quit.action', {}, function(res, status) {
					if ('OK' == res) {
						window.location.href = 'login.html';
					}
				});
			});
		});
	</script>




	<script type="text/javascript">
		$.backstretch("69.jpg");
	</script>

	<script type="text/javascript">
		$(function() {
			$('#queryone').click(function() {
				$.post('queryone.action', {
					search : $('#search-box-value').val()
				}, function(res, status) {
					if ('REE' == res) {
						alert('没有查到数据');
					} else if ('REE2' == res) {
						alert('请输入正确信息');
					} else {
						console.log(res);
						window.location.href = 'queryone.html?id=' + res;
					}
				});
			});
		})
		if (!Cookies.get("user")) {
			window.location.href = "login.html";
		}
	</script>
</body>
</html>
